package com.geo.geotool.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * • @Description: TODO
 * • @author  : yell
 * • @date : 2021/12/14 14:43
 */
@Mapper
public interface PostGisMapper {
    /***
     * 坐标转换
     * @param sourceWkId 原坐标WKID
     * @param targetWkId 目标坐标WKID
     * @param wkt 坐标串信息
     * @return
     */
    @Select("SELECT ST_AsGeoJson(ST_Transform(st_geometryfromtext(#{wkt},${sourceWkId}),${targetWkId}));")
    String transform(@Param("sourceWkId") String sourceWkId, @Param("targetWkId") String targetWkId, @Param("wkt") String wkt);

}
